package com.usefullc.english.enums;


import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 内容类型
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ContentTypeEnum {


    VIDEO(0, "视频"),

    AUDIO(1, "音频"),

    TEXT(2, "文本"),



    ;


    private int code;
    private String value;

    ContentTypeEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }



    public static ContentTypeEnum getByCode(int code) {
        for (ContentTypeEnum s : ContentTypeEnum.values()) {
            if (s.getCode() == code) {
                return s;
            }
        }
        return null;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getValue() {


        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

}
